<!--#include file="inc/conn.asp" -->
<!--#include file="inc/Function.asp" -->




<%
CheckAdmin()'
Action=Request("Action")
character_no=checkstr(trim(request("character_no")))

    Select Case Request("Action")
		Case "Save"
             Save()
		Case "Add"
             Add()
        Case Else 
			Main()
    End Select




Sub Save()
user_id=trim(request("user_id"))
user_no=checkstr(trim(request("user_no")))
character_name=trim(request("character_name"))
dwmoney=Int(trim(request("dwmoney")))
wlevel=Int(trim(request("wlevel")))
wskillpoint=Int(trim(request("wskillpoint")))
wstatpoint=Int(trim(request("wstatpoint")))
wstr=Int(trim(request("wstr")))
wdex=Int(trim(request("wdex")))
wcon=Int(trim(request("wcon")))
wspr=Int(trim(request("wspr")))
dwpvppoint=trim(request("dwpvppoint"))
dwpeerage=trim(request("dwpeerage"))
bypcClass=trim(request("bypcClass"))
quitguild=trim(request("quitguild"))
dwstoremoney=Int(trim(request("dwstoremoney")))
dwstoragemoney=Int(trim(request("dwstoragemoney")))
wWinrecord=Int(trim(request("wWinrecord")))
wLoserecord=Int(trim(request("wLoserecord")))
wpkcount=trim(request("wpkcount"))
wCHaoticlevel=trim(request("wCHaoticlevel"))
wGrade=trim(request("wGrade"))
dwLowPPoint=trim(request("dwLowPPoint"))
dwExp=trim(request("dwExp"))
dwdivisionexp=trim(request("dwdivisionexp"))
wMapIndex=trim(request("wMapIndex"))
wposx=trim(request("wposx"))
wposy=trim(request("wposy"))
dwlowallrexp=trim(request("dwlowallrexp"))
Description=trim(request("Description"))


	if isnumeric(wCHaoticlevel)=false Or isnumeric(dwmoney)=false  Or isnumeric(wlevel)=false  Or isnumeric(wskillpoint)=false  Or isnumeric(wstatpoint)=false  Or isnumeric(wstr)=false  Or isnumeric(wdex)=false  Or isnumeric(wcon)=false  Or isnumeric(wspr)=false  Or isnumeric(dwpvppoint)=false  Or isnumeric(bypcClass)=false  Or isnumeric(dwstoremoney)=false  Or isnumeric(dwstoragemoney)=false  Or isnumeric(wWinrecord)=false  Or isnumeric(wLoserecord)=false  then
		response.write "{""msg"":""错误:参数错误,请检查数据是否为数字,且不能为空!"",""status"":""no""}"
		response.end
	end If
	
	If wskillpoint<0 Or dwmoney<0 Or wstatpoint<0  Then 
			response.write "{""msg"":""错误:参数错误,请检查数据是否小于0!"",""status"":""no""}"
			response.end
	end If

	'If wlevel<1 or wGrade<1 Then 
	If wlevel<1  Then 
			response.write "{""msg"":""错误:等级不能小于1级."",""status"":""no""}"
			response.end
	end If





If request("ischeck")="1" Then 
	formpoint=wstatpoint+wstr+wdex+wcon+wspr
	truepoint=wlevel*Perpoint+Initpoint

		If formpoint<>truepoint Then 
		response.write "{""msg"":""错误:当前属性点"&formpoint&".正常属性点为"&truepoint&",多出"&(formpoint)-(truepoint)&"点,请仔细检查数据."",""status"":""no""}"
		response.end
		end If
End If 

	If bypcClass<0 Or bypcClass>12 Then 
				response.write "{""msg"":""错误:职业代码错误."",""status"":""no""}"
		response.end
	End If 


  set rs=server.CreateObject("adodb.recordset")
  sqlstr="select * from User_Character where character_no='"&character_no&"'"
  rs.open sqlstr,conn_c,1,3


	if rs("character_name")<>character_name then note=note&",名称"&rs("character_name")&"为"&character_name
	if rs("bypcClass")<>Int(bypcClass)  then note=note&",职业"&GetClass(rs("bypcClass"))&"为"&GetClass(bypcClass)
	if int(rs("wlevel"))<>int(wlevel) then note=note&",等级"&rs("wlevel")&"为"&wlevel
	if int(rs("wstatpoint"))<>int(wstatpoint)then note=note&",属性点"&rs("wstatpoint")&"为"&wstatpoint
	if Cdbl(rs("dwmoney"))<>Cdbl(dwmoney)then note=note&",金币"&rs("dwmoney")&"为"&dwmoney
	if Cdbl(rs("dwstoremoney"))<>Cdbl(dwstoremoney)then note=note&",商店金币"&rs("dwstoremoney")&"为"&dwstoremoney
	if Cdbl(rs("dwstoragemoney"))<>Cdbl(dwstoragemoney)then note=note&",仓库金币"&rs("dwstoragemoney")&"为"&dwstoragemoney
	if int(rs("wstr"))<>int(wstr)then note=note&",力量"&rs("wstr")&"为"&wstr
	if int(rs("wdex"))<>int(wdex)then note=note&",敏捷"&rs("wdex")&"为"&wdex
	if int(rs("wcon"))<>int(wcon)then note=note&",体力"&rs("wcon")&"为"&wcon
	if int(rs("wspr"))<>int(wspr)then note=note&",精神"&rs("wspr")&"为"&wspr
	
	logtxt=note
		If logtxt<>"" Then
			logtxt=Right(logtxt,(Len(logtxt)-1)) '删掉logtxt的第一个逗号
		End If 
		
		If Description="" Then Description="null"
		Call Add_Log(user_no,user_id,character_no,character_name,logtxt,"2",Description)	'写日志
		Action_Str=" 代码:"&logtxt&""




rs("character_name")=character_name
rs("dwmoney")=dwmoney
rs("wlevel")=wlevel
rs("wskillpoint")=wskillpoint
rs("wstatpoint")=wstatpoint
rs("wstr")=wstr
rs("wdex")=wdex
rs("wcon")=wcon
rs("wspr")=wspr
rs("wpkcount")=wpkcount
rs("dwpvppoint")=dwpvppoint
rs("bypcClass")=bypcClass
rs("dwstoremoney")=dwstoremoney
rs("dwstoragemoney")=dwstoragemoney
rs("wWinrecord")=wWinrecord
rs("wLoserecord")=wLoserecord
rs("wCHaoticlevel")=wCHaoticlevel
rs("wGrade")=wGrade
rs("dwLowPPoint")=dwLowPPoint
rs("dwExp")=dwExp
rs("dwdivisionexp")=dwdivisionexp
'rs("wMapIndex")=wMapIndex
'rs("wposx")=wposx
'rs("wposy")=wposy
rs("dwlowallrexp")=dwlowallrexp
rs.update
rs.close


	set rs=nothing
	conn.close
	set conn=Nothing
	response.write "{""msg"":""角色"&character_name&"修改成功!"&Action_Str&""",""status"":""yes""}"

	response.end
End Sub


Sub Add() '发送装备

attribute=Trim(request("attribute"))
attribute2=Trim(request("attribute2"))
attribute3=Trim(request("attribute3"))
attribute4=Trim(request("attribute4"))
'hole=Trim(request("hole"))
hole1=Trim(request("hole1"))
hole2=Trim(request("hole2"))
hole3=Trim(request("hole3"))
hole4=Trim(request("hole4"))
number=Int(Trim(request("number")))
lognumber=number
wIndex=Trim(request("wIndex"))
wIndex2=Trim(request("wIndex2"))
character_name=Trim(request("character_name"))
Description=Trim(request("Description"))

					'If len(Description) < 2 Then response.write "{""msg"":""发送装备必须添加备注!"",""status"":""no""}":Response.End

'If session("SuperAdmin")<>1 then
'	If Len(note)<2  Then 
'		response.write "<script language=javascript>alert('发送装备必须仔细填写说明!');history.back()</script>"
'		response.end
'	end If
'End If 

If wIndex2<>"" Then 
	If IsNumeric(wIndex2) Then wIndex=wIndex2
End If 

If IsNumeric(hole)=False  Or IsNumeric(wIndex)=False Then
response.write "error!"
response.End
End If 


If number>0  Then '如果number>0 那么发送带数量的物品
number=Hex(number)
If Len(number)>4 Then 
response.write "error!"
Else
number=Right("000"&number,4)
End If
info=number
byheader=1

Else  '否则发送正常装备


Lenatt=(Len(attribute)+Len(attribute2)+Len(attribute3)+Len(attribute4))/6

Select Case  Lenatt
Case 1
header1=2
Case 2
header1=4
Case 3
header1=6
Case 4
header1=8
Case Else
header1=0
End Select


'0属性0洞=01洞=0+16 1属性0洞=5 1洞=5+16 1属性0洞=5 2属性0洞=6 3属性0洞=7 4属性0洞=8

Lenhole=hole1+hole2+hole3+hole4
If Len(Lenhole)=0 Then 
byheader=header1 
End If 

If Len(Lenhole)=4 Then 
byheader=header1+16
End If 

If Len(Lenhole)=8 Then 
byheader=header1+32
End If 

If Len(Lenhole)=12 Then 
byheader=header1+48
End If 

If Len(Lenhole)=16 Then 
byheader=header1+64
End If 

info=Lenhole&attribute&attribute2&attribute3&attribute4 '属性

End If

post_no=createssn '物品唯一ID


'response.write "<br>post_no="&post_no
'response.write "<br>info="&info
'response.end
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from user_postbox "
rs.open sqlstr,conn_c,1,3
Rs.AddNew
rs("character_no")=character_no
rs("post_no")=post_no
rs("from_char_nm")="CNCTZ道具管理系统" 
rs("post_sort")=4 'gm发送为0
rs("post_title")="商品发放"
rs("body_text")="系统发放或补偿物品"
rs("state_tag")=0 '0未查看1以查看
rs("item_tag")=1  '1未取出 2已取出
rs("byHeader")=byHeader
rs("wIndex")=wIndex '装备代码
rs("dwSerialNumber")="00000000000000000000000000000000" '未知
rs("info")=info '亮金属性
rs("dil_tag")=0	'未知
rs("include_dil")=0	'未知
rs("ipt_time")=Now() '发送时间
rs("expire_time")=Now()+15 '过期日期
rs("reg_bindate")="00000000"	'未知
rs("exp_bindate")="00000000"	'未知
rs("byRebirthFlag")="1"	'未知

rs.update
rs.close


If wIndex<>"" Then 
		'查找物品名称
		  SET RS3 = conn_i.Execute("select itemname,itemid from Item where itemid="&Windex&"")
		   If rs3.eof Or rs3.bof Then 
		  itemname="未知"
		  Else
		  itemname=rs3(0)
		  End If 
		  rs3.close
		  Set rs3=Nothing

		
		'写日志
		Action_Str=ITEM_Name&",ID:"&ID64&logtxt
		Call Add_Log(user_no,user_id,character_no,character_name,Action_Str,"3",logtxt)	'写日志

		End If 








	set rs=nothing
	conn.close
	set conn=Nothing	
	response.write "{""msg"":"""&itemname&" 发送成功!\n\n代码:"&wIndex&"\n\n数量:"&lognumber&""",""status"":""yes""}"
response.end

End Sub


Sub Main() 
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from user_character where character_no='"&character_no&"'"
rs.open sqlstr,conn_c,1,1
if rs.eof or rs.bof then
  response.write "找不到该角色!"
  response.end
end If


character_name=rs("character_name")
character_no=rs("character_no")


		 strtitle=character_name&"-信息修改"
		Call  head(strtitle)
If browser()="pc" Then Call  LeftMenu()
%>
  <!-- 右侧主体开始 -->
  <div class="page-content">
<%Call  mnav()%>
		<div class="weadmin-body">
		
<%Call  Search()%>
<div class="layui-fluid">

            <div class="layui-row layui-col-space15">
        <div class="layui-row">





<form class="layui-form layui-form-pane" action="Char_Edit.asp" name=form method="get">
         <div class="layui-form-item layui-form-text"> 
				<label class="layui-form-label">
                        角色ID:<%=rs("character_no")%>
                    </label>
                    <table  class="layui-table layui-input-block">
                        <tbody>
                            <tr>
                                <td>

                  角色名 / 职业 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div class="layui-inline layui-show-xs-block">
                                    <input type="text" name="character_name"   autocomplete="off" class="layui-input"  value="<%=rs("character_name")%>" readonly>
		  </div>  
 <div class="layui-inline layui-show-xs-block">
                                <select name="bypcClass" id="bypcClass">
<option value="0" <%If rs("bypcClass")=0 Then response.write "selected"%>>骑  士</option>
            <option value="1" <%If rs("bypcClass")=1 Then response.write "selected"%>>弓箭手</option>
            <option value="2" <%If rs("bypcClass")=2 Then response.write "selected"%>>法  师</option>
            <option value="3" <%If rs("bypcClass")=3 Then response.write "selected"%>>驱魔师</option>
            <option value="4" <%If rs("bypcClass")=4 Then response.write "selected"%>>巫师</option>
            <option value="5" <%If rs("bypcClass")=5 Then response.write "selected"%>>狂战士</option>
            <option value="6" <%If rs("bypcClass")=6 Then response.write "selected"%>>魔枪手</option>
			<option value="7" <%If rs("bypcClass")=7 Then response.write "selected"%>>龙骑士</option>
            <option value="9" <%If rs("bypcClass")=9 Then response.write "selected"%>>暗咒师</option>
            <option value="10" <%If rs("bypcClass")=10 Then response.write "selected"%>>女武神</option>
            <option value="11" <%If rs("bypcClass")=11 Then response.write "selected"%>>死神</option>
            <option value="12" <%If rs("bypcClass")=12 Then response.write "selected"%>>女战圣</option>
									</select>
                                </div>


 用户: <div class="layui-inline layui-show-xs-block">
        <%
SET RSU = Conn.Execute("SELECT user_no, user_id,login_flag,vip FROM user_profile WHERE user_no = '"&rs("user_no")&"'")
If RSU.eof Then 
response.write"错误帐号"
else
user_no=rsu("user_no")
user_id=rsu("user_id")
%>
        <b><a href="User_Edit.asp?user_no=<%=rsu("user_no")%>">
        <%
		If rsu("login_flag")=0 Then response.write rsu("user_id") Else response.write "<FONT COLOR=""#CC0000"">"&rsu("user_id")&"</FONT>"
		If  rsu("vip")=1 Then response.write "<FONT COLOR=""#FF00FF""> [VIP]</FONT>"
		%>
        </a></b>
        <%
End If 

rsu.close
Set rsu=Nothing

%>
</div>  
		  </div> 
                </div>
                                </td>
                            </tr>
 <tr>
                                <td>
					

        
角色/商店/仓库金币
        <div class="layui-inline layui-show-xs-block"><input class="layui-input"   name=dwmoney id="dwmoney" style="WIDTH: 110px" value="<%=RS("dwmoney")%>" maxlength="10"></div><a href="javascript:" onClick="document.form.dwmoney.value='500000000'">5E</a> <a href="javascript:" onClick="document.form.dwmoney.value='1000000000'">10E</a>&nbsp;&nbsp;
        <div class="layui-inline layui-show-xs-block"><input  class="layui-input" name=dwstoremoney id="dwstoremoney" style="WIDTH: 110px" value="<%=RS("dwstoremoney")%>" maxlength="10"></div>
       <a href="javascript:" onClick="document.form.dwstoremoney.value='500000000'">5E</a> <a href="javascript:" onClick="document.form.dwstoremoney.value='1000000000'">10E</a>&nbsp;&nbsp;
<div class="layui-inline layui-show-xs-block"><input  class="layui-input" name=dwstoragemoney id="dwstoragemoney" style="WIDTH: 110px" value="<%=RS("dwstoragemoney")%>" maxlength="10"></div>
       <a href="javascript:" onClick="document.form.dwstoragemoney.value='100000000'">1E</a> <a href="javascript:" onClick="document.form.dwstoragemoney.value='1000000000'">10E</a>

                                </td>
                            </tr>

<tr>
                                <td>
									
                  技能点/属性点/等级 <div class="layui-inline layui-show-xs-block"><input name=wskillpoint class="layui-input" style="WIDTH: 75px" value="<%=RS("wskillpoint")%>" onClick="select()">				  </div> 
        <div class="layui-inline layui-show-xs-block"><input name=wstatpoint id="wstatpoint" class="layui-input"  style="WIDTH: 75px" value="<%=RS("wstatpoint")%>" onClick="select()">	</div> 
		<div class="layui-inline layui-show-xs-block"><INPUT name=wlevel id="wlevel" class="layui-input" style="WIDTH: 75px" value="<%=RS("wlevel")%>" onClick="select()">		</div> 


 
		<a href="javascript:" onClick="document.form.wstatpoint.value='970';document.form.wstr.value='12';document.form.wdex.value='1';document.form.wcon.value='1';document.form.wspr.value='1';document.form.wlevel.value='195';document.form.wskillpoint.value='195'">195</a>
		<a href="javascript:" onClick="document.form.wstatpoint.value='995';document.form.wstr.value='12';document.form.wdex.value='1';document.form.wcon.value='1';document.form.wspr.value='1';document.form.wlevel.value='200';document.form.wskillpoint.value='200'">200</a>

                                </td>
                            </tr>
<tr>
                                <td> 经验/层级/头衔EXP
		<div class="layui-inline layui-show-xs-block"><INPUT class="layui-input" name=dwExp id="dwExp" style="WIDTH: 75px" value="<%=RS("dwExp")%>" onClick="select()"></div> 
			<div class="layui-inline layui-show-xs-block"><INPUT class="layui-input" name=dwdivisionexp id="dwdivisionexp" style="WIDTH: 75px" value="<%=RS("dwdivisionexp")%>" onClick="select()"></div> 
			<div class="layui-inline layui-show-xs-block"><INPUT class="layui-input"  name=dwlowallrexp id="dwlowallrexp" style="WIDTH: 75px" value="<%=RS("dwlowallrexp")%>" onClick="select()"></div> </td>
                            </tr>
                           <tr>
                                <td> 力/敏捷/体力/精神 &nbsp;&nbsp;
        <div class="layui-inline layui-show-xs-block"><INPUT name=wstr id="wstr" class="layui-input" style="WIDTH: 75px" value="<%=RS("wstr")%>" onClick="select()"></div> 
        <div class="layui-inline layui-show-xs-block"><INPUT name=wdex id="wdex"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wdex")%>" onClick="select()"></div> 
        <div class="layui-inline layui-show-xs-block"><INPUT name=wcon id="wcon"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wcon")%>" onClick="select()"></div> 
		<div class="layui-inline layui-show-xs-block"><INPUT name=wspr id="wspr"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wspr")%>" onClick="select()"></div> 
</td>
                            </tr>


                           

                            <tr>
                                <td>
									  PK/PVP/趋向/军阶&nbsp;&nbsp;
		<div class="layui-inline layui-show-xs-block"><input name=wpkcount id="wpkcount"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wpkcount")%>" onClick="select()"></div> 
        <div class="layui-inline layui-show-xs-block"><INPUT name=dwpvppoint id="dwpvppoint"  class="layui-input" style="WIDTH: 75px" value="<%=RS("dwpvppoint")%>"></div> 
	  <div class="layui-inline layui-show-xs-block"><INPUT name=wCHaoticlevel id="wCHaoticlevel"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wCHaoticlevel")%>"> </div> 
        <div class="layui-inline layui-show-xs-block"><input name=wGrade id="wGrade"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wGrade")%>" type="text" onkeyup="limitInput(this);"></div> 
        <script type="text/javascript">
            function limitInput(o){
                var value=o.value;
                var min=1;
                var max=60;
                if(parseInt(value)<min||parseInt(value)>max){
                    alert('军衔等级设置超出最大值，请设置为1-60范围内');
                    o.value='';
                }
            }
        </script>
	   /
	<a href="dev.htm#&TB_iframe=true" title="计算军衔点" target="_blank" class="thickbox">计算</a>



                        </td>
                            </tr>

                           <tr>
                                <td> 胜/输/P点:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<div class="layui-inline layui-show-xs-block"><INPUT name=wWinrecord id="wWinrecord"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wWinrecord")%>" onClick="select()"></div> 
      <div class="layui-inline layui-show-xs-block">  <INPUT name=wLoserecord id="wLoserecord"  class="layui-input" style="WIDTH: 75px" value="<%=RS("wLoserecord")%>"></div> 
      <div class="layui-inline layui-show-xs-block">  <INPUT name=dwLowPPoint id="dwLowPPoint" class="layui-input" style="WIDTH: 75px" value="<%=RS("dwLowPPoint")%>"></div> 
        </td>
                            </tr>


							<tr>
                                <td>
									  <%if RS("oldname")<>"" then response.write "旧名字:"&RS("oldname")&"&nbsp;|&nbsp;"%>
		<%if RS("login_time")<>"" then response.write "登录时间:"&RS("login_time")&"&nbsp;|&nbsp;"%>
		<a href="Char_List.asp?txtSearch=0x<%=ShowHex(rs("user_ip_addr"))%>&SearchType=1"><%if not isnull(rs("user_ip_addr")) then response.write cip(Int(Hexnumber(ShowHex(rs("user_ip_addr")))))%></a>
        位置:<%=MapName(rs("wMapIndex"))%>
    &nbsp;|&nbsp;
  战盟:
  <%
SET Rsg = conn_c.Execute("select GUILD_CHAR_INFO.guild_code,GUILD_INFO.guild_name from GUILD_CHAR_INFO inner Join GUILD_INFO on GUILD_CHAR_INFO.guild_code=GUILD_INFO.guild_code where GUILD_CHAR_INFO.character_name='"&rs("character_name")&"'")
If Rsg.eof Then 
response.write"暂未加入"
disp="disabled"
else
response.write rsg("guild_name")
end if 
Rsg.close
%>
                                </td>
                            </tr>

							<tr>
                                <td>


							<a  onclick="WeAdminShow('<%=character_name%>仓库管理','user_item.asp?Itemtype=1&character_no=<%=character_no%>')" href="javascript:;"><button type="button" class="layui-btn layui-btn-sm">仓库管理</button> </a>&nbsp;&nbsp;&nbsp;	
							
                            <a  onclick="WeAdminShow('<%=character_name%>背包管理','user_item.asp?Itemtype=2&character_no=<%=character_no%>')" href="javascript:;"><button type="button" class="layui-btn layui-btn-sm">背包道具</button> </a>&nbsp;&nbsp;&nbsp;	


                            <a  onclick="WeAdminShow('<%=character_name%>角色道具','user_item.asp?Itemtype=3&character_no=<%=character_no%>')" href="javascript:;"><button type="button" class="layui-btn layui-btn-sm">角色道具</button> </a>&nbsp;&nbsp;&nbsp;	
                            <a  onclick="WeAdminShow('<%=character_name%>商店道具','user_item.asp?Itemtype=4&character_no=<%=character_no%>')" href="javascript:;"><button type="button" class="layui-btn layui-btn-sm">商店道具</button> </a>&nbsp;&nbsp;&nbsp;	
                            <a  onclick="WeAdminShow('<%=character_name%>邮箱道具','user_item.asp?Itemtype=5&character_no=<%=character_no%>')" href="javascript:;"><button type="button" class="layui-btn layui-btn-sm">邮箱道具</button> </a>

                                </td>
                            </tr>






                            <tr>
                                <td>

									 
                             
                               

<input name="character_name" type="hidden" value="<%=character_name%>">
<input name="character_no" type="hidden" value="<%=character_no%>">


<input name="user_no" type="hidden" id="user_no" value="<%=user_no%>">
<input name="user_id" type="hidden" id="user_no" value="<%=user_id%>">





								<div class="layui-inline layui-show-xs-block">
								<input type="text" name="Description" class="layui-input"placeholder="修改金珠等操作必须备注" style="width:300px">
								</div> 
                             <input type="checkbox" name="IsMoveMap" title="自救">
							     <input type="checkbox" name="ischeck" title="验证" value="1" checked>&nbsp;&nbsp;
							 <button class="layui-btn  layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="Edituser_character"> 修改信息</button>



                                </td>
                            </tr>
											
										
                        </tbody>
                    </table>
                </div>
       
			</form>



<form class="layui-form layui-form-pane"  name="myform" id="myform" action="">

<input type="hidden" name="user_no" value="<%=user_no%>">
  <input type="hidden" name="user_id"  value="<%=user_id%>">
         <div class="layui-form-item layui-form-text"> 
				<label class="layui-form-label">
                        装备制作
                    </label>
                    <table  class="layui-table layui-input-block">
                        <tbody>





                            <tr>
                                <td width="100px">
                                    类别2
                                </td>
                                <td>





<%
set rsi=server.createobject("adodb.recordset")
sql = "select * from ANclass order by Nclassid asc"
rsi.open sql,conn_i,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rsi.eof 
        %>subcat[<%=count%>] = new Array("<%= trim(rsi("Nclass"))%>","<%= trim(rsi("classid"))%>","<%= trim(rsi("Nclassid"))%>");
        <%
        count = count + 1
        rsi.movenext
        loop
        rsi.close
        %>
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.wIndex.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.wIndex.options[document.myform.wIndex.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<%
        sql = "select * from Aclass"
        rsi.open sql,conn_i,1,1
	if rsi.eof and rsi.bof then
	response.write "请先添加栏目。"
	response.end
	else
%><div class="layui-inline layui-show-xs-block" style="width:150px">
<select name="classid" onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)">
        <option selected value="<%=trim(rsi("classid"))%>"><%=trim(rsi("class"))%></option>
<%      dim selclass
         selclass=rsi("classid")
        rsi.movenext
        do while not rsi.eof
%><option value="<%=trim(rsi("classid"))%>"><%=trim(rsi("class"))%></option>       
<%
        rsi.movenext
        loop
	end if
        rsi.close
%>
       </select> </div>
    <div class="layui-inline layui-show-xs-block" style="width:150px">
    <select name="wIndex" >                  
<%sql="select * from ANclass where classid="&selclass
rsi.open sql,conn_i,1,1
if not(rsi.eof and rsi.bof) then
%><option selected value="<%=rsi("NclassID")%>"><%=rsi("Nclass")%></option>
<% rsi.movenext
do while not rsi.eof%><option value="<%=rsi("NclassID")%>"><%=rsi("Nclass")%></option>
<% rsi.movenext
loop
end if
        rsi.close
        set rsi = nothing
        conn_i.Close
        set conn_i = nothing
%>
    </select>
</div>



    自定义:
    <div class="layui-inline layui-show-xs-block"><input type="text" name="wIndex2" id="wIndex2" style="WIDTH: 98px" class="layui-input"  title="使用自定义代码后将不发送选择的道具."></div>  
数量:
<div class="layui-inline layui-show-xs-block"><input style="WIDTH: 65px"  class="layui-input" name=number value="0"></div>  
							
                            </div>

                                </td>
                            </tr>
                            <tr>
                                <td>
								装备属性
                                </td>
                                <td>
									  <div class="layui-inline layui-show-xs-block" style="width:150px">
<select name="attribute" id="attribute" onchange="changeSelect(document.all.attribute2,this.value),changeSelect(document.all.attribute3,this.value),changeSelect(document.all.attribute4,this.value)">
<option value="">装备属性一</option>
	<%=Item_attrib()%>
</select>
</div>
<div class="layui-inline layui-show-xs-block"  style="width:150px">
<select  name="attribute2" id="attribute2">
  <option value="">装备属性二</option>
	<%=Item_attrib()%>
</select>
</div>
<div class="layui-inline layui-show-xs-block" style="width:150px"> 
<select name="attribute3" id="attribute3">
  <option value="">装备属性三</option>
		<%=Item_attrib()%>
  </select>
  </div>
  <div class="layui-inline layui-show-xs-block" style="width:150px">
 <select name="attribute4" id="attribute4">
  <option value="">装备属性四</option>
	<%=Item_attrib()%>
</select>
</div>


                                </td>
                            </tr>
							<tr>
                                <td>
								石头属性
                                </td>
                                <td>

  <div class="layui-inline layui-show-xs-block" style="width:150px">
  <select name="hole1" id="hole1" onchange="changeSelect(document.all.hole2,this.value),changeSelect(document.all.hole3,this.value),changeSelect(document.all.hole4,this.value)">
            <option value="">石头属性一</option>
			<%=Stone_attrib()%>
          </select>
		  </div>
  <div class="layui-inline layui-show-xs-block" style="width:150px">
          <select name="hole2" id="hole2" onchange="changeSelect(document.all.hole3,this.value),changeSelect(document.all.hole4,this.value)">
            <option value="">石头属性二</option>
			<%=Stone_attrib()%>
          </select>
		  </div>
  <div class="layui-inline layui-show-xs-block" style="width:150px">
          <select name="hole3" id="hole3" onchange="changeSelect(document.all.hole4,this.value)">
			<option value="">石头属性三</option><%=Stone_attrib()%>
          </select>
		  </div>
  <div class="layui-inline layui-show-xs-block" style="width:150px">
          <select name="hole4" id="hole4">
		      <option value="">石头属性四</option>
			<%=Stone_attrib()%>
          </select>
</div>

                                </td>
                            </tr>	
										
							<tr>
                                <td>
								备注信息
                                </td>
                                <td>

            <input name="character_no" type="hidden" value="<%=RS("character_no")%>"><input name="username" type="hidden" value="<%=RS("character_name")%>">
		                          <div class="layui-inline layui-show-xs-block">
                                    <input type="text" name="Description"  placeholder="备注信息" autocomplete="off" class="layui-input" style="width:435px">
                                </div>  					
                                <div class="layui-inline layui-show-xs-block">
                                    <button class="layui-btn layui-btn-normal layui-btn-sm"  lay-submit="" lay-filter="Add_Item">  发送装备</button>
                                </div>
                                </td>
                            </tr>						
                        </tbody>
                    </table>
                </div>
             <input type="hidden" name="character_no"  value="<%=character_no%>">
             <input type="hidden" name="character_name"  value="<%=character_name%>">          
			</form>




        </div>
    </div>


	

<form class="layui-form layui-form-pane" action="Char_Edit.asp" method="get">
<input type="hidden" name="user_no" value="<%=user_no%>">
  <input type="hidden" name="user_id"  value="<%=user_id%>">
         <div class="layui-form-item layui-form-text"> 
				<label class="layui-form-label">
                        套装发送
                    </label>
                    <table  class="layui-table layui-input-block">
                        <tbody>
                            <tr>
                                <td width="100px">
                                    装备
                                </td>
                                <td>
		<input name="bclass" type="radio" id="radio" value="QS1" lay-skin="primary" title="骑">
         <input type="radio" name="bclass" id="radio2" value="GS1" lay-skin="primary" title="弓">
          <input type="radio" name="bclass" id="radio3" value="FS1" lay-skin="primary" title="法">
          <input type="radio" name="bclass" id="radio4" value="QM1" lay-skin="primary" title="驱">
          <input type="radio" name="bclass" id="radio5" value="KZ1" lay-skin="primary" title="狂">
          <input type="radio" name="bclass" id="radio6" value="MQ1" lay-skin="primary" title="枪">
		<input type="radio" name="bclass" id="radio7" value="WS1" lay-skin="primary" title="巫">
		
                            </div>

                                </td>
                            </tr>
                            <tr>
                                <td>
								技能
                                </td>
                                <td>
		<input name="bclass" type="radio" id="radio13" value="QSJN"  lay-skin="primary" title="骑">
          
          <input type="radio" name="bclass" id="radio14" value="GSJN"  lay-skin="primary" title="弓">
          
          <input type="radio" name="bclass" id="radio15" value="FSJN"  lay-skin="primary" title="法">
          
          <input type="radio" name="bclass" id="radio16" value="QMJN"  lay-skin="primary" title=" 驱">
         
          <input type="radio" name="bclass" id="radio17" value="KZJN"  lay-skin="primary" title="狂">
          
          <input type="radio" name="bclass" id="radio18" value="MQJN"  lay-skin="primary" title="枪">
          
		<input type="radio" name="bclass" id="radio19" value="WSJN"  lay-skin="primary" title="巫">
		


                                </td>
                            </tr>
							<tr>
                                <td>
								道具
                                </td>
                                <td>

 <input name="bclass" type="radio" id="radio25" value="DAOJV1"  lay-skin="primary" title="常用道具">

	 <input name="bclass" type="radio" id="radio25" value="DAOJV2"  lay-skin="primary" title="附魔道具">
            <div class="layui-inline layui-show-xs-block">
                                    <button class="layui-btn layui-btn-normal layui-btn-sm"  lay-submit="" lay-filter="Add_All_Item">  发送装备</button>
                                </div>
                                </td>
                            </tr>	
										
									
                        </tbody>
                    </table>
                </div>
             <input type="hidden" name="character_no"  value="<%=character_no%>">
             <input type="hidden" name="character_name"  value="<%=character_name%>">          
			</form>



<%	rs.close
	set rs=nothing
	conn.close
	set conn=Nothing
	end Sub
%>



		</div>
  </div>
  </div>

    <script>
//监听提交
layui.use('form', function(){
  var form = layui.form;
    form.on('submit(Edituser_character)', function(data){
    // layer.msg(JSON.stringify(data.field));//弹出json格式所有表单的值
	//return false;
    $.ajax({
      type:"get",
       url:"Char_edit.asp?Action=Save",
	  data: data.field,
      dataType:"json",
      success:function(data){
        if(data.status=='yes'){
          layer.msg(data.msg, {icon: 1});
          //var url = "{:U('device/getinfo')}"; //成功跳转的url
          //setTimeout(window.location.href=url,2000);
        }else{
          layer.msg(data.msg, {icon: 2});
        }
      },
    });
	return false;
  });
});
        </script>
		<script>
//监听提交
layui.use('form', function(){
  var form = layui.form;
    form.on('submit(Add_Item)', function(data){
    // layer.msg(JSON.stringify(data.field));//弹出json格式所有表单的值
	//return false;
    $.ajax({
      type:"get",
       url:"Char_edit.asp?Action=Add",
	  data: data.field,
      dataType:"json",
      success:function(data){
        if(data.status=='yes'){
		   layer.msg(data.msg, {icon: 1,time:5000});
          //var url = "{:U('device/getinfo')}"; //成功跳转的url
          //setTimeout(window.location.href=url,2000);
        }else{
		   layer.msg(data.msg, {icon: 2,time:5000});
        }
      },
    });
	return false;
  });
});

//监听提交
layui.use('form', function(){
  var form = layui.form;
    form.on('submit(Add_All_Item)', function(data){
    // layer.msg(JSON.stringify(data.field));//弹出json格式所有表单的值
	//return false;
    $.ajax({
      type:"get",
       url:"Additem.asp",
	  data: data.field,
      dataType:"json",
      success:function(data){
        if(data.status=='yes'){
		   layer.msg(data.msg, {icon: 1,time:5000});
          //var url = "{:U('device/getinfo')}"; //成功跳转的url
          //setTimeout(window.location.href=url,2000);
        }else{
		   layer.msg(data.msg, {icon: 2,time:5000});
        }
      },
    });
	return false;
  });
});

        </script>
<script>

    layui.use('table', function () {
        var $ = layui.jquery,
            table = layui.table,
            form = layui.form;

        // 让绑定在select的change事件触发
        form.on('select', function (data) {
            $(data.elem).trigger('change', data.elem);
			form.render('select'); //这个很重要

        })
    });
</script> 
	<%Call  footer%>
</body>
</html>